package LeetCode;

public class No104 {
    public static void main(String[] args) {

    }
    public int maxDepth(TreeNode root) {
        return getNode(root);
    }

    public static int getNode(TreeNode node){
        if(node==null) return 0;
        int leftdeep = getNode(node.left)+1;
        int rightdeep = getNode(node.right)+1;
        return Math.max(leftdeep,rightdeep);
    }
}
